//
//  PNode.h
//  ProjectL
//
//  Created by Nguyen Tan Loc on 8/16/13.
//  Copyright (c) 2013 Nguyen Tan Loc. All rights reserved.
//

#import "CCPhysicsSprite.h"
#import "PhysicInterface.h"
#import "PhysicSystem.h"
#import "DynamicObjectInterface.h"

@class Path;
@class PLine;

typedef enum
{
    eNT_USER_NODE = 0,
    eNT_PATH_NODE,
    
} eNodeType;

typedef enum
{
    eNS_IDLE = 0,
    eNS_CONNECTING,
    eNS_CONTECTED,
    eNS_SPREADED,
} eNodeState;

@interface PNode : CCPhysicsSprite <PhysicInterface, DynamicObjectInterface>
{
    eNodeType   mType;
    eNodeState  mState;
    
    PNode *mNextNode;
    PLine *mLine;
    CCSprite *mVirus;
    NSArray *mListAction;
}

@property (nonatomic, assign) eNodeType _type;
@property (nonatomic, assign) eNodeState _state;
@property (nonatomic, assign) PNode *_nextNode;
@property (nonatomic, assign) PLine *_line;

-(id) initWithType:(eNodeType)type;
-(Path *) getPath;
-(BOOL) isTail; 
-(void) spread;
-(void) infected;

@end
